<script setup>

import Son from './Son.vue';
import {reactive, ref} from "vue";

// const money = ref(100_0000);
// const books = ref(['Java' , 'Mysql' , 'Linux' , 'C++' , 'Python' , 'Go']);
const data = reactive({
  money: 100_0000,
  books: ['Java', 'Mysql', 'Linux', 'C++', 'Python', 'Go']
});
let moneyMinis = (sonMoney) => {
  data.money += sonMoney;
};

</script>

<template>
  <div style="background-color: #ffffff">
    <h2>Father</h2>
    <button @click="data.money += 10000">打款</button>
<!--    <Son :money="data.money" :books="data.books"-->
<!--         @buy="moneyMinis"-->
<!--    />-->
    <!--    <Son v-bind:money="money" :books="books"></Son>-->
    <Son v-bind="data">
      <template v-slot:title>
        <button>点击带你飞</button>
      </template>
      <template v-slot:btn>
        买飞机
      </template>
    </Son>

  </div>

</template>

<style scoped>

</style>